<!-- @format -->

<template>
  <UseSpace title="基本使用">
    <Form>
      <Field name="field" :rules="isRequired" />
      <ErrorMessage name="field" />
    </Form>
  </UseSpace>
</template>
<script setup>
  import { Field, Form, ErrorMessage } from 'vee-validate'
  function isRequired(value) {
    if (value && value.trim()) {
      return true
    }
    return 'This is required'
  }
</script>
